<?php

class Database {
	 
	protected $conn;

	public function doQuery($query) {
		require("config/config.php");
		
		if (!isset($this->conn)) {
			$this -> conn = mssql_connect(
						$dbInfo["host"],
						$dbInfo["username"],
						$dbInfo["password"]
					);
			mssql_select_db($dbInfo["database"],$this->conn);
		}
		
		$result = mssql_query($query, $this->conn);
		
		return $result;
	}
}

$GLOBALS["DB"] = new Database();

?>